const {
  hijackPageConfig,
} = require('jws-tools-wx');

const {
  tokenVerify,
  getAuthUser
} = require('./utils/auth');

/**
 * 页面劫持，修改生命周期，挂载方法
 */
hijackPageConfig({
  methods: {
    getAuthUser
  },
  lifeCycle: {
    onLoad() {
      const {
        auth
      } = this.config;
      //验证token
      auth && tokenVerify();
    },
    onShow() {
      console.log("lifeCycle-onShow");
    }
  }
});